<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      function rev(n) {
        var str = n;
        console.log(str.length)
        // str = str.split("").reverse().join("");
        str1 = str.slice(0,1);
        str2 = str.slice(2, 7);
        str3 = str.slice(6, 12);
        str4 = str.slice(12, 19);
        var str5="";
        str5 = str5.concat(str4,str3,str2,str1);
        return console.log(str5);
      }
      rev("i come from beijing");
    </script>
  </head>
  <body></body>
</html>
